package com.foolishbird.sdk.content;

import android.app.Activity;
import android.app.FragmentManager;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.view.WindowManager;

import com.foolishbird.sdk.params.bean.RoleInfo;


public abstract class HNSSNAbsActivity implements HNSSNActivityListener {

    private Activity mActivity;

    public abstract void openFloatWindow();

    public abstract void openFloatWindowContent();

    public abstract void closeFloatWindow();

    public abstract void startPushWindowMessageTask(RoleInfo roleInfo);

    @Override
    public void onCreate(Activity activity) {

        this.mActivity = activity;

        Configuration config = activity.getResources().getConfiguration();
        if (Configuration.ORIENTATION_PORTRAIT == config.orientation) {
            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        } else {
            activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
        }
    }

    @Override
    public void onStart() {

    }

    @Override
    public void onRestart() {

    }

    @Override
    public void onResume() {

    }

    @Override
    public void onPause() {

    }

    @Override
    public void onStop() {

    }

    @Override
    public void onDestroy() {

    }

    @Override
    public void onBackPressed() {

    }

    @Override
    public void onNewIntent(Intent intent) {

    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {

    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {

    }

    @Override
    public void onRequestPermissionResult(int requestCode, String[] permissions, int[] grantResults) {

    }

    FragmentManager getFragmentManager() {
        if (mActivity != null) {
            return mActivity.getFragmentManager();
        }
        return null;
    }

    protected WindowManager getWindowManager(){
        if (mActivity != null) {
            return mActivity.getWindowManager();
        }
        return null;
    }

    protected Activity getActivity(){
        return this.mActivity;
    }

}
